package generator

import "beergo/plugins/maker"

func init() {
	ComPage()
	Article()
	ArticleCategory()
	Question()
	QuestionCategory()
}

func ComPage() {
	c := maker.CreateTable("ComPage","单页","com")
	c.AddTitle()
	c.AddContent()
	c.AddCode()

	c.Generate()
}

func Article() {
	c := maker.CreateTable("Article","文章模块","com")
	c.AddManyToOne("cat","文章分类","ArticleCategory")
	c.AddTitle()
	c.AddText("cover","封面")
	c.AddContent()
	c.AddInt("reads","阅读量")
	c.AddCreateAt()

	c.Generate()
}
func ArticleCategory() {
	c := maker.CreateTable("ArticleCategory","文章分类","com")
	c.AddName()
	c.Generate()
}


func Question() {
	c := maker.CreateTable("Question","常见问题","com")
	c.AddManyToOne("cat","分类","QuestionCategory")
	c.AddTitle()
	c.AddText("cover","封面")
	c.AddContent()
	c.AddInt("reads","阅读量")
	c.AddCreateAt()

	c.Generate()
}
func QuestionCategory() {
	c := maker.CreateTable("QuestionCategory","常见问题分类","com")
	c.AddName()
	c.Generate()
}
